Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add test for block mover (#8011) #8392

Merged
merged 3 commits into from
Aug 7, 2018
Merged

Conversation

tofumatt
Copy link
Member

@tofumatt tofumatt commented Aug 2, 2018

Description

Adds e2e tests for the change made in #8011.

How has this been tested?

It's a test 😄


describe( 'block mover', () => {
beforeEach( async () => {
await newDesktopBrowserPage();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we open a page for all the tests e.g: await newDesktopBrowserPage(); is in a before all block and not in a beforeEach block. Was there any special reason for this difference? Can the newDesktopBrowserPage call be in a beforeAll block?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not but I'll double-check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, scratch that; we need an empty post for each test. If we use beforeAll we don't have a clean slate that we need to know how many blocks are there.

Our tests in the past use beforeAll possibly for speed? The globals in the tests are kinda weird... anyway, this needs a fresh state for each test so beforeEach it is...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we use newDesktopBrowserPage in beforeAll and newPost in beforeEach don't we get a fresh state on each test? We will just reuse the same tab but we start with an empty post on each test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that out locally and it seemed to hang. I'll give it another go though, I just realised my environment could have been messed up locally from an unstashed, unrelated change.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this test case @tofumatt the code makes sense to me and test passed when I executed them 👍

@tofumatt tofumatt force-pushed the chore/test-for-8011 branch 2 times, most recently from 52574d1 to 10979b9 Compare August 7, 2018 22:50
@tofumatt tofumatt merged commit 47a69e1 into master Aug 7, 2018
@tofumatt tofumatt deleted the chore/test-for-8011 branch August 7, 2018 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants